import { S } from '../../s';
import { IPSAppDELogic } from '../../app/dataentity/ipsapp-delogic';
import { IPSAppDataEntity } from '../../app/dataentity/ipsapp-data-entity';
import { IPSDEDELogicLogic } from './ipsdedelogic-logic';
import { IPSDELogic } from './ipsdelogic';
import { IPSDELogicParam } from './ipsdelogic-param';
import { PSDELogicNodeImpl } from './psdelogic-node-impl';

export class PSDEDELogicLogicImpl
  extends PSDELogicNodeImpl
  implements IPSDEDELogicLogic
{
  protected dstpsappdelogic: IPSAppDELogic;
  getDstPSAppDELogic(): IPSAppDELogic | null {
    if (this.dstpsappdelogic != null) return this.dstpsappdelogic;
    const value = this.M.getDstPSAppDELogic;
    if (value == null) {
      return;
    }
    this.dstpsappdelogic = this.getDstPSAppDataEntity().findPSAppDELogic(value);
    return this.dstpsappdelogic;
  }

  protected dstpsappdataentity: IPSAppDataEntity;
  getDstPSAppDataEntity(): IPSAppDataEntity | null {
    return (
      this.dstpsappdataentity ||
      (this.dstpsappdataentity = this.fillObjectModel(
        S._f,
        this.M.getDstPSAppDataEntity,
        S._321,
      ) as IPSAppDataEntity)
    );
  }

  protected dstpsdelogicparam: IPSDELogicParam;
  getDstPSDELogicParam(): IPSDELogicParam | null {
    if (this.dstpsdelogicparam != null) return this.dstpsdelogicparam;
    const value = this.M.getDstPSDELogicParam;
    if (value == null) {
      return;
    }
    const ipsdelogic = this.getParentPSModelObject(S._200) as IPSDELogic;
    if (ipsdelogic != null) {
      this.dstpsdelogicparam = ipsdelogic.findPSDELogicParam(value);
    }
    return this.dstpsdelogicparam;
  }

  protected retpsdelogicparam: IPSDELogicParam;
  getRetPSDELogicParam(): IPSDELogicParam | null {
    if (this.retpsdelogicparam != null) return this.retpsdelogicparam;
    const value = this.M.getRetPSDELogicParam;
    if (value == null) {
      return;
    }
    const ipsdelogic = this.getParentPSModelObject(S._200) as IPSDELogic;
    if (ipsdelogic != null) {
      this.retpsdelogicparam = ipsdelogic.findPSDELogicParam(value);
    }
    return this.retpsdelogicparam;
  }
  get cls(): string {
    return 'PSDEDELogicLogicImpl';
  }
  instanceof(cls: string): boolean {
    if (cls == S._3a8) return true;
    return super.instanceof(cls);
  }
}
